﻿using System.Data;
using System.Data.Common;

namespace SS.Common.DBBuilder.DBInteraction
{
    /// <summary>
    /// The interface is used to provide the means to get data from database
    /// </summary>
    public interface IDataProvider
    {
        #region Properties

        /// <summary>
        /// Data source
        /// </summary>
        string DataSource { get; set; }

        /// <summary>
        /// Database name
        /// </summary>
        string DataBaseName { get; set; }

        /// <summary>
        /// Store SQL command
        /// </summary>
        string Query { get; set; }

        /// <summary>
        /// Keep connection to database
        /// </summary>
        DbConnection ObjConnection { get; set; }

        /// <summary>
        /// Object Command to execute update data
        /// </summary>
        DbCommand ObjCommand { get; set; }

        /// <summary>
        /// A set of SqlCommand
        /// </summary>
        DbDataAdapter ObjDataAdapter { get; set; }

        #endregion

        #region Methods

        /// <summary>
        /// Fill data from database to dataset
        /// </summary>
        /// <param name="ds">DataSet contains returned data from DB</param>
        /// <param name="tblName">Identifier table name in dataset</param>
        void FillDataSet(ref DataSet ds, string tblName);

        #endregion
    }
}
